package cn.com.smartdevices.bracelet.chart;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.RectF;

import cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem;
import cn.com.smartdevices.bracelet.chart.util.C0804t;

/* renamed from: cn.com.smartdevices.bracelet.chart.H */
public class C0730H extends BarItem implements Comparable<C0730H> {
    public C0730H(Context context) {
        super(context);
    }

    public int m8470a(C0730H c0730h) {
        return c0730h.f3884c - this.f3884c;
    }

    public void draw(Canvas canvas, float f, float f2, float f3, float f4, float f5) { // m8471a
        draw(canvas, this.mRect, f, f2, f3, f4, f5);
    }

    protected void draw(Canvas canvas, RectF rectF, float f, float f2, float f3, float f4, float f5) { // m8472a
        if (this.f3886e || rectF.height() != 0.0f) {
            int i;
            float h;
            float f6;
            StatisticChart c0720a = (StatisticChart) getParent();
            float f7 = c0720a.f3823M;
            float n = c0720a.f3824N;
            if (rectF.right < f7 || rectF.left > n) {
                i = c0720a.ad;
                h = c0720a.ag;
            } else {
                f7 = rectF.left < f7 ? f7 - rectF.left : rectF.right > n ? rectF.right - n : 0.0f;
                n = rectF.width() / 2.0f;
                if (f7 >= n) {
                    i = c0720a.ad;
                    h = c0720a.ag;
                } else if (f7 == 0.0f) {
                    i = c0720a.ac;
                    h = c0720a.af;
                } else {
                    f6 = f7 / n;
                    i = C0804t.m8826a(c0720a.ac, c0720a.ad, f6);
                    h = c0720a.af - ((c0720a.af - c0720a.ag) * f6);
                }
            }
            mRenderer.f3958c.setColor(i);
            n = rectF.centerX();
            f6 = f2 == -1 ? rectF.top : f2;
            f7 = f3 == -1 ? rectF.top : f3;
            if (f2 == -1 && f3 == -1) {
                f6 = this.mDensity * 185.0f;
                f7 = rectF.top;
            }
            f7 = ((f7 - f6) * f) + f6;
            h *= this.mDensity;
            h = (f2 != -1 || f3 == -1) ? h * f : h * (1.0f - f);
            canvas.drawCircle(n, f7, h, mRenderer.f3958c);
        }
    }

    public /* synthetic */ int compareTo(C0730H obj) {
        return m8470a((C0730H) obj);
    }
}
